﻿namespace SweeperPrototype.Business.Fields
{
    public class ExposureRIC : RIC
    {
        public ExposureRIC(string value) : base(value) { }

        public static bool operator ==(ExposureRIC lhs, ExposureRIC rhs)
        {
            if (ReferenceEquals(null, lhs)) return false;
            if (ReferenceEquals(null, rhs)) return false;

            return lhs.Value == rhs.Value;
        }

        public static bool operator !=(ExposureRIC lhs, ExposureRIC rhs)
        {
            return !(lhs == rhs);
        }

        public static bool Equals(ExposureRIC lhs, string rhs)
        {
            if (ReferenceEquals(null, lhs)) return false;
            if (ReferenceEquals(null, rhs)) return false;

            return lhs.Value == rhs;
        }


        public bool Equals(ExposureRIC other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.Value, Value);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(RIC)) return false;
            return Equals((RIC)obj);
        }

        public override int GetHashCode()
        {
            return (Value != null ? Value.GetHashCode() : 0);
        }

        public override string ToString()
        {
            return Value;
        }
    }
}